const Service = require("egg").Service;

class ResourceService extends Service {

    async getRsList() {
        try{
            let rsList = this.app.model.Resource.findAll({});
            return rsList
        }catch(error){
            return error
        }
    }
    async postRsList(val) {
        try{
            let rsList = this.app.model.Resource.create({
                title:val.title,
                code:val.code,
                url:val.download
            });
            return rsList
        }catch(error){
            return error
        }
    }
    
    
} 
module.exports = ResourceService;